package c.h.a.w.l;

import c.h.a.m0.j;
import c.h.a.w.e;
import java.io.File;
import java.util.Objects;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/* compiled from: MultiThreadAnalyzerTask2 */
public class c extends b {
    public ThreadPoolExecutor h = new ThreadPoolExecutor(8, 8, 0, TimeUnit.MILLISECONDS, new LinkedBlockingDeque());

    /* compiled from: MultiThreadAnalyzerTask2 */
    public class a implements Runnable {
        public e a;
        public File b;

        public a(e eVar, File file) {
            this.a = eVar;
            this.b = file;
        }

        public e a(File file) {
            e eVar = new e(file.isDirectory(), file.getName(), this.a);
            eVar.b = file.lastModified();
            return eVar;
        }

        public void run() {
            File file = this.b;
            if (file != null && !c.this.g) {
                if (file.isDirectory()) {
                    File[] listFiles = this.b.listFiles();
                    if (listFiles != null) {
                        int i = 0;
                        int length;
                        File file2;
                        if (listFiles.length > 3) {
                            length = listFiles.length;
                            while (i < length) {
                                file2 = listFiles[i];
                                c cVar = c.this;
                                cVar.a(new a(a(file2), file2));
                                i++;
                            }
                            return;
                        }
                        length = listFiles.length;
                        while (i < length) {
                            file2 = listFiles[i];
                            new a(a(file2), file2).run();
                            i++;
                        }
                        return;
                    }
                    return;
                }
                this.a.a = this.b.length();
            }
        }
    }

    public synchronized void a(Runnable runnable) {
        if (!this.h.isShutdown()) {
            this.h.execute(runnable);
        }
    }

    public void b(e eVar) {
        if (!(eVar == null || this.g)) {
            c.h.a.w.k.c cVar = this.d;
            Objects.requireNonNull(cVar);
            if (!eVar.d) {
                cVar.b((double) eVar.a, j.d(eVar.e));
                if (!eVar.i.contains(cVar)) {
                    eVar.i.add(cVar);
                }
            }
            if (!eVar.d) {
                if (eVar.a > 0) {
                    c.h.a.w.k.e eVar2 = this.c;
                    Objects.requireNonNull(eVar2);
                    eVar2.b(new c.h.a.w.k.e.e(eVar.e, eVar.a), eVar, eVar2.a);
                }
                String str = eVar.e;
                if (!(str.startsWith(".") || str.equalsIgnoreCase(".nomedia"))) {
                    if (eVar.a > 10485760) {
                        this.b.a.add(eVar);
                    }
                    str = str.toLowerCase();
                    if (str.endsWith(".log")) {
                        this.a.b.add(new File(eVar.b()));
                    } else if (str.endsWith(".tmp") || str.endsWith(".temp") || str.equals("temp") || str.equals("tmp")) {
                        this.a.a.add(new File(eVar.b()));
                    } else if (eVar.a == 0) {
                        this.a.c.add(new File(eVar.b()));
                    }
                }
            } else if (eVar.h.isEmpty()) {
                this.a.d.add(new File(eVar.b()));
            }
            if (eVar.d) {
                if (!".RecycleBinHW".equalsIgnoreCase(eVar.e)) {
                    for (e b : eVar.h.values()) {
                        b(b);
                    }
                }
            }
        }
    }
}
